angular.module("myApp")
.controller("QuestionController_newqusetion",["$scope","QuestionService_newqusetion",
    function($scope,QuestionService_newqusetion){
        QuestionService_newqusetion.getData().success(function(res){
            $scope.newqusetion_list = res[0].subCateList
        })
}])
.controller("QuestionController_hotQuestion",["$scope","QuestionService_hotQuestion",
    function($scope,QuestionService_hotQuestion){
        QuestionService_hotQuestion.getData().success(function(res){
            $scope.hotQuestion_list = res[0].subCateList
        })
}])
.controller("QuestionConterller_needQuestion",["$scope","QuestionService_needQuestion",
    function($scope,QuestionService_needQuestion){
        QuestionService_needQuestion.getData().success(function(res){
            $scope.needQuestion_list = res[0].subCateList
        })
}])
.controller("questionStyle",["$scope",function($scope){
	$scope.flag = true;
	var jsUlAsk = document.getElementsByClassName("question_ask")[0];
	var jsUiAskPic = document.getElementsByClassName("question_ask_pic");
	var jsList = document.getElementsByClassName("question_list");
	for(var i = 0 ; i < jsUlAsk.children.length;i++){
		jsUlAsk.children[i].onclick=function(e){
			e = e || window.event;
			for(var j = 0 ; j <  jsUlAsk.children.length ; j++){
				jsUlAsk.children[j].className = "questionStyle_black";
				jsUiAskPic[j].style.display = "none";
				jsList[j].style.display = "none";
			}
			this.className = "questionStyle_green";
			this.children[0].style.display = "inline-block";
			jsList[parseInt(e.target.getAttribute("aaa"))].style.display = "block"
		}
	}
}])
.controller("questionsrachController",["$scope",function($scope){
	$scope.flag = false;
}])


